package org.shoukaiseki.tools.mybatis.generator.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

import javax.sql.DataSource;

/**
 * <br>
 *
 * @author 蒋カイセキ    Japan-Tokyo  18-10-23 下午1:44<br>
 * ブログ http://www.shoukaiseki.top/<br>
 * E-メール jiang28555@Gmail.com<br>
 **/
@Configuration
public class DataSourceConfig {

    @Bean
    @ConfigurationProperties(prefix = "sks.datasource")
    public DataSource dataSource() {
        System.out.println("---------------");
        // 属性由springboot自动填写
        DriverManagerDataSource druidDataSource = new DriverManagerDataSource();
//        DruidDataSource druidDataSource=new DruidDataSource();
//        druidDataSource.setMaxWait(5000);
        return druidDataSource;
    }

}
